package com.dd.seckill.single.mapper;

import com.dd.seckill.single.pojo.DO.SeckillGoods;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 秒杀商品表 Mapper 接口
 * </p>
 *
 * @author liuxianmeng
 * @since 2025-09-06
 */
public interface SeckillGoodsMapper extends BaseMapper<SeckillGoods> {

    /**
     * 使用悲观锁查询行记录
     * @param seckillGoodsId
     * @return
     */
    SeckillGoods queryWithPessmisticLock(@Param("seckillGoodsId") Long seckillGoodsId);

    /**
     * 减库存
     * @param seckillGoodsId
     * @return
     */
    Integer decrStock(@Param("seckillGoodsId") Long seckillGoodsId);
}
